<template>
<!--我的粉丝-->
  <div class="fans" v-if="fansInfo">
    <ul>
      <li v-for="(val,index) in fansInfo" :key="index"><userAvatar :avatar='val'><template slot="text">关注</template></userAvatar></li>
    </ul>
  </div>
</template>

<script>
import require from "requests/index"
import userAvatar from 'components/notbusiness/userAvatar'
export default {
  name:'fans',
  data(){
    return {
      fansInfo:null
    }
  },
  components:{
    userAvatar
  },
  methods:{
    getfansInfo(){
      require.getFans(this.$store.state.userId).then(res=>{
        this.fansInfo=res.data.followeds
        //console.log(this.fansInfo)
      })
    }
  },
  mounted(){
    this.getfansInfo()
  }
}
</script>

<style scoped lang='less'>
  .fans{
    width: 100%;
    ul{
      display: flex;
      flex-wrap: wrap;
    }
    li{
      margin: 15px 50px;
    }
  }
</style>